<script type="text/javascript" src="<?php echo $path."/ckfinder.js"; ?>"></script>
<script type="text/javascript">
	function BrowseServer<?php echo $fieldName?>()
	{
		// You can use the "CKFinder" class to render CKFinder in a page:
		var finder = new CKFinder();
		finder.selectActionFunction = function( fileUrl, data ) {
			SetFileField<?php echo $fieldName?>(fileUrl);
		}
		finder.popup();
	}
	// This is a sample function which is called when a file is selected in CKFinder.
	function SetFileField<?php echo $fieldName?>( fileUrl )
	{
		document.getElementById( '<?php echo get_class($model).'_'.$fieldName; ?>' ).value = fileUrl;
	}
</script>
		<input class="span2" id="<?php echo get_class($model).'_'.$fieldName; ?>" name="<?php echo get_class($model).'['.$fieldName.']'; ?>" value="<?php echo $model->$fieldName;?>" type="text" size="60" />
		<input type="button" class="btn" value="Select File" onclick="BrowseServer<?php echo $fieldName?>();" />